package org.tlipoca.smarticle.client;

import org.genntii.smcommon.result.Result;
import org.genntii.smdomain.dto.ArticleTagRelationalDTO;
import org.genntii.smdomain.entity.ArticleTagRelational;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Map;

@FeignClient("sm-articleTagRelational")
public interface ArticleTagRelationalClient {

    @GetMapping("/article_tag_relational/{articleId}")
    Result<ArrayList<ArticleTagRelational>> getArticleTagRelationalByArticleId(@PathVariable Long articleId);

    @GetMapping("/article_tag_relational")
    Result<Map<String, ArrayList<Long>>> getTagIdsByArticleIds(@RequestParam("articleIds")ArrayList<Long> articleIds);

    @PostMapping("/article_tag_relational")
    Result addArticleTagRelational(@RequestBody ArticleTagRelationalDTO articleTagRelationalDTO);
}
